<?php
class indexControl extends commonControl{
//显示的主页框架，除欢迎界面以外；
    function index(){
    	$this->display();
    }
//显示欢迎界面；
    function welcome(){
    	$db = M("user");
    	$name = $_SESSION["username"];
    	$res = $db -> field("logintime,loginip") -> find(array("username"=>$name));
    	$this->assign("time",$res["logintime"]);
    	$this->assign("ip",$res["loginip"]);
    	$this->display();
    }
//改变模板；
    function changestyle(){
        $style =$_POST['style'];
        $db=M("user");
        $data = array("adminstyle"=>$style);
        $_SESSION['adminstyle']=$style;
        echo $db->where("uid=".$_SESSION['user'])->save($data)>-1?1:0;
    }
}